//
//  BaseView.m
//  PlayCatchGame
//
//  Created by 流言 on 2018/1/15.
//  Copyright © 2018年 清正. All rights reserved.
//

#import "BaseView.h"

@implementation BaseView

+ (instancetype)loadNib:(NSString*)nibName frame:(CGRect)frame {
    BaseView *view =[[[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil] firstObject];
    view.viewFrame =frame;
    view.frame =frame;
    return view;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    if (!CGRectEqualToRect(CGRectZero, self.viewFrame) ) {
        self.frame =self.viewFrame;
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
